.class final Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;
.super Ljava/lang/Object;
.source "ZMUpgradeHelper.java"

# interfaces
.implements Lretrofit/Callback;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/zuiapps/library/helper/ZMUpgradeHelper;->onUpgradeEvent(Landroid/content/Context;ZLcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x8
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Lretrofit/Callback",
        "<",
        "Lorg/json/JSONObject;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

.field final synthetic val$context:Landroid/content/Context;

.field final synthetic val$isUpgradeByAuto:Z


# direct methods
.method constructor <init>(Landroid/content/Context;ZLcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;)V
    .registers 4

    .prologue
    .line 155
    iput-object p1, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    iput-boolean p2, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$isUpgradeByAuto:Z

    iput-object p3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public failure(Lretrofit/RetrofitError;)V
    .registers 5
    .param p1, "error"    # Lretrofit/RetrofitError;

    .prologue
    .line 209
    iget-object v0, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v0, :cond_b

    .line 210
    iget-object v0, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    const/4 v1, -0x1

    const/4 v2, 0x0

    invoke-interface {v0, v1, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    .line 212
    :cond_b
    return-void
.end method

.method public bridge synthetic success(Ljava/lang/Object;Lretrofit/client/Response;)V
    .registers 3

    .prologue
    .line 155
    check-cast p1, Lorg/json/JSONObject;

    invoke-virtual {p0, p1, p2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->success(Lorg/json/JSONObject;Lretrofit/client/Response;)V

    return-void
.end method

.method public success(Lorg/json/JSONObject;Lretrofit/client/Response;)V
    .registers 11
    .param p1, "jsonObject"    # Lorg/json/JSONObject;
    .param p2, "response"    # Lretrofit/client/Response;

    .prologue
    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 158
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3, p1}, Lcom/zuiapps/library/parse/UpgradeParse;->parse(Landroid/content/Context;Lorg/json/JSONObject;)Lcom/zuiapps/library/model/UpgradeModel;

    move-result-object v2

    .line 160
    .local v2, "model":Lcom/zuiapps/library/model/UpgradeModel;
    if-eqz v2, :cond_54

    .line 161
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v3

    const-string v4, "last_version"

    iget v5, v2, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;I)V

    .line 162
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v3

    const-string v4, "update_desc"

    iget-object v5, v2, Lcom/zuiapps/library/model/UpgradeModel;->desc:Ljava/lang/String;

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 163
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeSharePrefHelper;

    move-result-object v3

    const-string v4, "update_url"

    iget-object v5, v2, Lcom/zuiapps/library/model/UpgradeModel;->apkUrl:Ljava/lang/String;

    invoke-virtual {v3, v4, v5}, Lcom/zuiapps/library/db/UpgradeSharePrefHelper;->setPref(Ljava/lang/String;Ljava/lang/String;)V

    .line 164
    iget-boolean v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$isUpgradeByAuto:Z

    if-eqz v3, :cond_91

    .line 165
    iget-object v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->upgradeType:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    sget-object v4, Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;->FORCE:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    if-eq v3, v4, :cond_41

    iget-object v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->upgradeType:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    sget-object v4, Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;->NEXT:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    if-ne v3, v4, :cond_5f

    .line 166
    :cond_41
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/restful/UpgradeReqRestAdapter;->getVersionCode(Landroid/content/Context;)I

    move-result v0

    .line 167
    .local v0, "appVersionCode":I
    iget v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    if-ge v0, v3, :cond_55

    .line 168
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 169
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v7, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    .line 205
    .end local v0    # "appVersionCode":I
    :cond_54
    :goto_54
    return-void

    .line 172
    .restart local v0    # "appVersionCode":I
    :cond_55
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 173
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v6, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    goto :goto_54

    .line 176
    .end local v0    # "appVersionCode":I
    :cond_5f
    iget-object v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->upgradeType:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    sget-object v4, Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;->IGNORE:Lcom/zuiapps/library/model/UpgradeModel$UpgradeType;

    if-ne v3, v4, :cond_54

    .line 177
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/restful/UpgradeReqRestAdapter;->getVersionCode(Landroid/content/Context;)I

    move-result v0

    .line 178
    .restart local v0    # "appVersionCode":I
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/db/UpgradeDBUtil;->getInstance(Landroid/content/Context;)Lcom/zuiapps/library/db/UpgradeDBUtil;

    move-result-object v3

    invoke-virtual {v3}, Lcom/zuiapps/library/db/UpgradeDBUtil;->getIgnoreVersionCode()I

    move-result v1

    .line 179
    .local v1, "ignoreVersionCode":I
    iget v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    if-eq v1, v3, :cond_54

    .line 180
    iget v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    if-ge v0, v3, :cond_87

    .line 181
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 182
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v7, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    goto :goto_54

    .line 185
    :cond_87
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 186
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v6, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    goto :goto_54

    .line 192
    .end local v0    # "appVersionCode":I
    .end local v1    # "ignoreVersionCode":I
    :cond_91
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$context:Landroid/content/Context;

    invoke-static {v3}, Lcom/zuiapps/library/restful/UpgradeReqRestAdapter;->getVersionCode(Landroid/content/Context;)I

    move-result v0

    .line 193
    .restart local v0    # "appVersionCode":I
    iget v3, v2, Lcom/zuiapps/library/model/UpgradeModel;->lastVersion:I

    if-ge v0, v3, :cond_a5

    .line 194
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 195
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v7, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    goto :goto_54

    .line 198
    :cond_a5
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    if-eqz v3, :cond_54

    .line 199
    iget-object v3, p0, Lcom/zuiapps/library/helper/ZMUpgradeHelper$4;->val$callback:Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;

    invoke-interface {v3, v6, v2}, Lcom/zuiapps/library/helper/ZMUpgradeHelper$ZMUpdateCallback;->callback(ILcom/zuiapps/library/model/UpgradeModel;)V

    goto :goto_54
.end method
